import request from '@/utils/request'
import type { Response, DivisionData } from '@/utils/type'

/**
 * 查询当前用户有权限的行政区划列表
 *
 * @param {string} roleId
 *
 * @param {string} refId
 */
export const divisionList = (
  roleId: string,
  refId: string
): Promise<Response<Array<DivisionData> | null>> => {
  return request('/proposal/area/queryCurrent', {
    method: 'GET',
    params: {
      roleId: roleId,
      refId: refId,
    },
  })
}
